<script setup >
import { ref } from 'vue';
 const status = ref(false);
 const filePath = ref();


filePath.value = [

'http://192.168.3.27:8080/models/glb/mclaren_elva.glb'
 
];

const object = ref(null);
function onMouseMove(event, intersected) {

  if (object.value) {
    object.value.material.color.setStyle("#fff");
  }
  if (intersected) {
    object.value = intersected.object;
    object.value.material.color.setStyle("#13ce66");
  }
}

const lights = ref();
lights.value = [

  {
    type: "PointLight",
    color: "#000000",
    position: { x: 10, y: -10, z: 10 },
    intensity: 5,
  },
  {
    type: "HemisphereLight",
    skyColor: "#00FF00",
    groundColor: "#000000",
    position: { x: 10, y: -10, z: 10 },
    intensity: 5,
  },
]
</script>
<template>
          <f-gl-scene  :filePath=filePath
                  @mousemove="onMouseMove"
                    backgroundColor="#FFFFFF"
                  :cameraPosition="{ x: 3, y: 3, z: 3 }"
                  height="300"
                  width="800"
                  :lights="lights"
                  :autoPlay="status"
                  outputEncoding="sRGB"
          />
</template>
<style></style>


